package ilearn.seata.job.java8.order.service;

import ilearn.seata.job.java8.order.dao.OrderDao;
import ilearn.seata.job.java8.order.entity.Order;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.math.BigDecimal;

@Service
public class OrderService {
    @Resource
    private OrderDao orderDao;

    public Order add(String accId, String goods, String name, BigDecimal amt){
        Order order = Order.builder().accId(accId).goods(goods).name(name).amt(amt).build();
        orderDao.insert(order);
        return order;
    }
}
